﻿#pragma once

#include <vulkan/vulkan.hpp>

//store the  widget's pipeline
struct SWidgetPipelines
{
    void Init();
  

    struct SLineItemVertexPushConstant
    {
        float Start[2];
        float End[2];
        float Color[4]; //rgba;
        float ZOrder;
    };
    vk::PipelineLayout CanvasWidgetLinePipelineLayout;
    vk::Pipeline CanvasWidgetLinePipeline;


    struct STriangleItemVertexPushConstant
    {
        float P0[2];
        float P1[2];
        float P2[2];
        float Padding[2];
        float Color[4];
        float ZOrder;
    };  
    vk::PipelineLayout CanvasWidgetTrianglePipelineLayout;
    vk::Pipeline CanvasWidgetTrianglePipeline;

    struct SImageItemVertexPushConstant
    {
        float LeftTop[2];
        float RightBottom[2];
        float ZOrder;
    };

    vk::PipelineLayout CanvasWidgetImagePipelineLayout;
    vk::Pipeline CanvasWidgetImagePipeline;

    struct STextItemVertexPushConstant
    {
        float LeftTop[2];
        float RightBottom[2];
        float Color[4];
        float ZOrder;
    };
    vk::PipelineLayout CanvasWidgetTextPipelineLayout;
    vk::Pipeline CanvasWidgetTextPipeline;

    struct SCircleItemVertexPushConstant
    {
        float Color[4];
        float Center[2];
        float Radius;
        float ZOrder;
    };

    vk::PipelineLayout CanvasWidgetCirclePipelineLayout;
    vk::Pipeline CanvasWidgetCirclePipeline;


    struct SCircleWidgetVertexPushConstant
    {
        float Color[4];
        float Center[2]; //圆心的位置, 以屏幕坐标为单位
        float Radius; //圆的半径，以屏幕坐标为单位
        float ZOrder;
    };
    vk::PipelineLayout CircleWidgetPipelineLayout;
    vk::Pipeline CircleWidgetPipeline;
    void CreateCircleWidgetPipeline();


    struct SRingWidgetVertexPushConstant
    {
        float Color[4];
        float Center[2]; //圆心的位置, 以屏幕坐标为单位
        float Radius; //圆的半径，以屏幕坐标为单位
        float Width; //环的宽度，以屏幕坐标为单位
        float ZOrder;
    };
    vk::PipelineLayout RingWidgetPipelineLayout;
    vk::Pipeline RingWidgetPipeline;
    void CreateRingWidgetPipeline();
protected:

};
